const errorConfig = [
  {
    code: -1,
    message: "当前繁忙，请稍后重试",
  },
  {
    code: -2,
    message: "当前繁忙，请稍后重试",
  },
  {
    code: -3,
    message: "签名错误，请退出重新登录",
  },
  {
    code: -4,
    message: "token错误",
  },
  {
    code: -7,
    message: "当前进程执行失败，请稍后重试",
  },
  {
    code: -11,
    message: "未找到您所查询的资源",
  },
  {
    code: -12,
    message: "文件上传失败，请稍后重试",
  },
  {
    code: -13,
    message: "唯一索引或主键冲突",
  },
  {
    code: -14,
    message: "当前操作人不存在，请联系【中台】",
  },
  {
    code: -15,
    message: "转单中的客诉不允许受理",
  },
  {
    code: -17,
    message: "文件格式不合法",
  },
  {
    code: -18,
    message: "请选择环境和应用",
  },
  {
    code: -19,
    message: "您暂时还没有受理此问题，不能进行转让操作",
  },
  {
    code: -20,
    message: "当前工单已完结，请勿重复操作",
  },
  {
    code: -21,
    message: "您暂时还没有受理此问题，不能进行完结操作",
  },
  {
    code: -22,
    message: "多人并发操作，请稍后重试",
  },
  {
    code: -23,
    message: "当前客诉已被受理，请勿重复受理",
  },
  {
    code: -24,
    message: "客诉状态不存在",
  },
  {
    code: -25,
    message: "请勿修改转让链接",
  },
  {
    code: -26,
    message: "请勿重复转让",
  },
  {
    code: -27,
    message: "redis链接池初始化失败，请联系【中台】",
  },
  {
    code: -28,
    message: "redis多数据源连接工厂不存在",
  },
  {
    code: -29,
    message: "您已受理当前客诉，不允许其他操作",
  },
  {
    code: -30,
    message: "您已经忽略当前客诉，请勿重复操作",
  },
  {
    code: -31,
    message: "当前提供的游戏账号没有删除",
  },
  {
    code: -32,
    message: "您当前操作的客诉不存在",
  },
  {
    code: -33,
    message: "当前客诉已完结，不允许越级操作",
  },
  {
    code: -34,
    message: "所要恢复的游戏账号不合法，所要恢复账号的游戏ID应当小于当前账号的游戏ID",
  },
  {
    code: 1001,
    message: "没有该用户",
  },
  {
    code: 1002,
    message: "密码错误",
  },
  {
    code: 1003,
    message: "绑定失败",
  },
  {
    code: 1004,
    message: "没有绑定",
  },
  {
    code: 1007,
    message: "您设置的用户名已经存在",
  },
  {
    code: 1022,
    message: "您所操作的游戏用户已经绑定邮箱",
  },
  {
    code: 1023,
    message: "您所操作的游戏用户未绑定第三方账号",
  },
  {
    code: 1029,
    message: "邮箱格式错误",
  },
  {
    code: 1032,
    message: "未找到该测试用户",
  },
  {
    code: 2001,
    message: "未找到该应用",
  },
  {
    code: 4000,
    message: "礼包名称数据重复",
  },
  {
    code: 4001,
    message: "没有该订单",
  },
  {
    code: 4002,
    message: "订单状态错误",
  },
  {
    code: 4003,
    message: "平台币不足",
  },
  {
    code: 4004,
    message: "更改订单状态时错误",
  },
  {
    code: 4005,
    message: "添加平台币错误",
  },
  {
    code: 4006,
    message: "不支持当前币种",
  },
  {
    code: 4009,
    message: "价格错误",
  },
  {
    code: 4013,
    message: "订单信息不匹配",
  },
  {
    code: 4014,
    message: "该补单申请已经存在",
  },
  {
    code: 6008,
    message: "验证码无效",
  },
  {
    code: 2051,
    message: "您没有当前应用权限，请联系【中台】申请",
  },
  {
    code: 2054,
    message: "单点服务器异常，请稍后重试",
  },
  {
    code: 2055,
    message: "登录code码过期，请稍后重试",
  },
  {
    code: 7001,
    message: "当前设备已存在未完成的上传日志事件",
  },
  {
    code: 7002,
    message: "此上传日志事件不存在",
  },
  {
    code: 7003,
    message: "此上传日志事件已完结",
  },
  {
    code: 5001,
    message: "消息推送所使用的模板未找到",
  },
  {
    code: 5002,
    message: "请求操作过于频繁，已触发分布式锁定机制",
  },
  {
    code: 5003,
    message: "应用的相关配置尚未被添加或设置",
  },
  {
    code: 5004,
    message: "消息防重复发送机制已达到限制，即相同消息在5分钟内最多只能发送1次",
  },
  {
    code: 5005,
    message: "消息防轰炸机制已触发限制，即单个用户在1分钟内最多只能接收1条不同消息",
  },
  {
    code: 5006,
    message: "请求的渠道信息有误或不被支持",
  },
  {
    code: 5007,
    message: "当前操作所关联的ACID中，未找到对应的DEVICE TOKEN",
  },
  {
    code: 5008,
    message: "该平台目前不支持消息推送功能",
  },
];
export function getErrorMessage(code: number | string) {
  const error = errorConfig.find((item) => item.code === code);
  return error ? error.message : "未知错误";
}
